//
//  OPZJHighSectionView.m
//  NewWorld
//
//  Created by 曾静 on 16/4/28.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "OPZJHighSectionView.h"

#import "OPColorWithHex.h"
@interface OPZJHighSectionView()

@property (nonatomic,weak) UILabel *onLable;


@end
@implementation OPZJHighSectionView


/**
 *  实例化的方法
 */
+(instancetype)headerViewWithTableView:(UITableView *)tableView{
    
    //1. 定义重用的标识
    NSString *reuseId = @"high";
    //2. 根据重用的标识获取重用的headerView
    OPZJHighSectionView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:reuseId];
    
    //3. 判断是否存在
    if (!headerView) {
        headerView = [[self alloc]initWithReuseIdentifier:reuseId];
//        headerView.frame  = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 30);
        headerView.contentView.backgroundColor = [OPColorWithHex colorWithHexString:@"f0f0f0"];
    }
    
    //4. 返回对象
    return headerView;
    
}



- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        //显示图标数据
        UILabel *onLabel = [[UILabel alloc]init];
        self.onLable = onLabel;
        self.onLable.font = [UIFont systemFontOfSize:13];
        self.onLable.textColor  = [OPColorWithHex colorWithHexString:@"343434"];
        [self addSubview:onLabel];
        
        
    }
    return self;
    
    
}



-(void)setTitle:(NSString *)title{
    _title = title;
    //设置UILable的数量
    self.onLable.text = [NSString stringWithFormat:@"%@",self.title];
    
 
//     UIScreen *screen = [UIScreen mainScreen];
    
    self.onLable.frame = CGRectMake(12, 0, 100, 30);
}









@end
